<template>
  <div class="loading"></div>
</template>

<script setup>
  import { onMounted, computed } from 'vue'
  import { useRouter } from 'vue-router'
  import { useStore } from 'vuex'
  import { logOut } from '../utils'

  const router = useRouter()
  const store = useStore()

  const user = computed(() => {
    return store.state.user
  })

  onMounted(() => {
    if (user.value == {}) {
      router.push('/home')
    } else {
      logOut()
    }
  })
</script>
<style scoped></style>
